<div class="layui-fluid layui-anim febs-anim-up" id="febs-index" lay-title="评分页">
    <div class="layui-row layui-col-space8 febs-container">
        <div class="layui-col-md12 layui-col-sm12 layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body layui-anim layui-anim-fadein">
                    <div class="layui-row welcome-info">
                        <div class="layui-col-md6 layui-col-sm12 layui-col-xs12">
                            <div class="layui-row welcome-info-wrapper">
                                <div class="user-header">
                                    </i><a href="javascript:history.go(-1);"><h3>返回上一页</h3></a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6 layui-col-sm12 layui-col-xs12">
                            <div class="layui-col-md-offset5">
                                <table class="login-count-table" id="table_case">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" lay-filter="example" method="post">
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;font-size: small">
                            <legend style="font-size: medium;font-weight: bold">提案详情:</legend>
                        </fieldset>
                        <label class="layui-form-label">提案编号</label>
                        <div class="layui-input-block">
                            <input type="text" name="ppsNo" readonly="true" class="layui-input"
                                   style="background-color: rgb(232,232,232)">
                        </div>
                        <br>
                        <div>
                            <label class="layui-form-label">提案日期</label>
                            <div class="layui-input-block">
                                <input type="text" name="ppsDate" readonly="true" class="layui-input"
                                       style="background-color: rgb(232,232,232)">
                            </div>
                        </div>
                        <br>
                        <div>
                            <label class="layui-form-label">提案名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="ppsName" readonly="true" class="layui-input" style="background-color: rgb(232,232,232)">
                            </div>
                        </div>
                        <br>
                        <div>
                            <label class="layui-form-label">提案事由</label>
                            <div class="layui-input-block">
                            <textarea type="text" name="reasonDesc" class="layui-textarea" readonly="true" style="background-color: rgb(232,232,232)"/>
                            </div>
                        </div>
                        <br>
                        <div>
                            <label class="layui-form-label">现状缺点</label>
                            <div class="layui-input-block">
                                <textarea type="text" name="defectDesc" class="layui-textarea" readonly="true" style="background-color: rgb(232,232,232)"/>
                            </div>
                        </div>
                        <br>
                        <label class="layui-form-label">改进意见</label>
                        <div class="layui-input-block">
                            <textarea type="text" name="proposeDesc" class="layui-textarea" readonly="true" style="background-color: rgb(232,232,232)"/>
                        </div>
                        <br>
                        <label class="layui-form-label">预期效果</label>
                        <div class="layui-input-block">
                            <textarea type="text" name="resulrDesc" class="layui-textarea" readonly="true" style="background-color: rgb(232,232,232)"/>
                        </div>
                        <br>
                        <hr>
                        <input name="orgId" id="orgId" type="hidden">
                        <br>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:inline="javascript">
    layui.use(['febs', 'rate', 'form', 'jquery', 'layer', 'table'], function () {
        let $ = layui.$ //重点处
            , rate = layui.rate
            , form = layui.form
            , layer = layui.layer
            , table = layui.table
            , url = window.location.href
            , febs = layui.febs
            , ppsNo = getQueryVariable("ppsNo");
        function getData() {
            if (ppsNo) {
                $.ajax({
                    url: "/sys/proposal/get/" + ppsNo,
                    method: 'get',
                    dataType: 'text',
                    contentType: 'application/json',
                    timeout: 5000,
                    success: function (res) {
                        var result = JSON.parse(res)
                        if (result.code == 200) {
                            var data = result.data;
                            //表单赋值
                            $(function () {
                                form.val('example', {
                                    "ppsNo": data.ppsNo
                                    , "ppsName": data.ppsName
                                    , "ppsDate": data.ppsDate
                                    , "reasonDesc": data.reasonDesc
                                    , "defectDesc": data.defectDesc
                                    , "proposeDesc": data.proposeDesc
                                    , "resulrDesc": data.resulrDesc
                                    , "deptname": data.deptname
                                });
                            });
                        }
                    },
                    error: function (data) {
                        alert(data)
                    }
                });
            }
        }

        getData()

        document.body.eventBus.addEvent('refreshProposalDetail' + ppsNo, function() {
            getData()
        })

        function getQueryVariable(variable) {
            return (window.location.toString().split("=")[1]);
        }
    });
</script>